#include <stdio.h>
#define uch unsigned char
#define LENGTH_CODES 29

int main(int argc,char **argv)
{
  int base_length[LENGTH_CODES];
  int length = 0;
  int extra_lbits[LENGTH_CODES] = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
  int length_code[256];

  int code,n;
  for (code = 0;code<LENGTH_CODES - 1;code++) {
    base_length[code] = length;
    for (n = 0;n<(1<<extra_lbits[code]);n++) {
      length_code[length++] = (uch) code;
    }
  }

  for (code = 0;code<29;code++) {
    printf("%d\t",base_length[code]);
  }

  
  printf("\n");
  printf("length_code = ");
  for (n = 0;n<256;n++) {
    printf("%d\t",length_code[n]);
  }
  printf("\n");
  return 0;
}
